<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>我的收藏</title>
    <meta name="Keywords" content="书">
    <meta property="qc:admins" content="15753240576117576375">
    
    <link href="__PUBLIC__/home/css/public1.css" rel="stylesheet" type="text/css">
    <link href="__PUBLIC__/home/css/mylist.css" rel="stylesheet" type="text/css">

    <script src="__PUBLIC__/home/js/jquery.js"></script>
</head>
    <body id="body">

        <div class="w w1280">
            <!------- 顶部工具栏 ------>

<div class="site-nav">
    <div class="wrap">
        <ul class="fl">
            <li>欢迎光临！</li>
                </ul>

                <ul class="fr">

                    <li class="mobile">
                        <div class="tit"><a href="__MODULE__/Index/index">首页</a></div>
                        
                    </li>
                    
                    <if condition="$V=SESSION('username')">
                    <li style="">
                        <a rel="nofollow" href="__MODULE__/Collect/index">我的收藏</a>
                    </li>
                    <li style="">
                        <a rel="nofollow" href="__MODULE__/User/index">会员中心</a>
                    </li>
                    <li style="">
                        <a rel="nofollow" href="__MODULE__/Cart/index/goodsNum/1">去购物车</a>
                    </li>
                    <li id="_logout" style="">
                        <a href="__MODULE__/Login/logout" class="logout">[退出]</a>
                    </li>
                    <li style="">
                        <a rel="nofollow"><{$V}></a>
                    </li>
                    <else/>
                    <li id="_register" style="">
                        <a rel="nofollow" href="__MODULE__/Register/index">[注册]</a>
                    </li>
                    <li id="_login" style="">
                        <a rel="nofollow" href="__MODULE__/Login/index">[登录]</a>
                    </li>
                    
                    </if>
                </ul>
            </div>
        </div>

            <div class="wrap">
                    <!--面包屑-->
                    <div class="crumbs"><a class="ml0" href="__MODULE__/index/index">首页</a>&gt;<a href="__MODULE__/user/index" class="j_ygnav">会员中心</a><span class="j_thridcrumbs hide">&gt;<a href="#" class="on j_thirdnav">我的收藏</a></span></div>
                <div class="content myyg">
                        <div class="sub">
                                  <div class="menu j_menu">
                                <dl>
                                    <dt>交易信息</dt>
                                    <dd>
                                        <ul>
                                            <li><a href="__MODULE__/order/myorder">我的订单</a></li>
                                            <li><a href="__MODULE__/collect/index">我的收藏</a></li>
                                            
                                        </ul>
                                    </dd>
                                    <dt>账号信息</dt>
                                    <dd>
                                        <ul>
                                            <li><a href="__MODULE__/user/mod">修改资料</a></li>
                                            <li><a href="__MODULE__/user/pwd">修改密码</a></li>
                                        </ul>
                                    </dd>

                                </dl>
                            </div>
                            <div>
                                <div class="ad" style="height: 308px;">
                                    <a href="#" target="_self" ><img src="__PUBLIC__/home/user/imgs/ad.jpg" width="194" height="308"></a>
                                </div>
                            </div>
                        </div>

                    




<!--我的收藏-->

<div class="main mylist">
    <div class="title">我的收藏</div>
    <div class="mylist-header">
        <table class="mylist-table">
            <tbody>
                <tr>
                    <th class="t-check"></th>
                    <th class="t-name">商品名称</th>
                    <th class="t-price">商品价格</th>
                    <th class="t-opera">操作</th>
                </tr>
            </tbody>
        </table>
    </div>
    <div class="mylist-list j_favos">

  <!-- 遍历收藏的商品 -->
        <foreach name='collect' item='collect'>
        <table class="mylist-table j_product">
            <tbody>
                <tr>
                    <td class="t-img"><a href="__MODULE__/Goodsdetail/index/goodsid/<{$collect.goodsid}>"><img class="j_product_img" src="__PUBLIC__/Upload/<{$collect.img}>"></a></td>
                    <td class="t-name"><a href="__MODULE__/Goodsdetail/index/goodsid/<{$collect.goodsid}>"><{$collect.goodsname}></a></td>
                    <td class="t-price">￥<{$collect.price}></td>
                    <td class="t-opera">
                        <a href="javascript:;" onclick="addCart(<{$collect.goodsid}>)" class="btn-orange btn-buy"><i></i>加入购物车</a>
                        <br><a class="j_unfavoopt" data-id="9f07e840-52a1-4ae8-9d20-ab0d25ca0731" href="__CONTROLLER__/del/id/<{$collect.collect_id}>">取消收藏</a>
                    </td>
                </tr>
            </tbody>
        </table>
    </foreach>

    </div>
</div>

</div>

</div>

        <!------- 页尾 ------->

        <include file="./Public/footer.html" />

</div>
<script type="text/javascript">
    //加入购物车
    function addCart(id){
        //获取商品的数量，赋值给变量m
        var m = 1;
        $.ajax({
            //定义url
            url:"__MODULE__/Cart/ajax",
            //数据的提交方式
            type:"post",
            //返回数据的格式
            dataType:"json",
            //需要提交的数据
            data:{'id':id,'m':m},
            //提交成功后对返回数据进行判断
            success:function(data){
                if(data==0){
                    alert("添加失败");
                    return false;
                }else{
                    alert("添加成功");
                }
            }
        });
        return true;
    }
</script>
</body>
</html>